﻿package code.admin 
{
	import flash.display.*;
	import gemini.utils.*
	import flash.events.*
	public class BackItem extends Sprite
	{
		var icn
		var mainframe;
		public var bitmap;
		var link;
		public function BackItem(mf,clp)
		{
			link=clp.link;
			mainframe=mf;
			icn=new backicon();
			addChild(icn);
			
			
			icn.btn.addEventListener(MouseEvent.MOUSE_DOWN,setBack);
			
			var bl=new BulkLoader();
			bl.addFile(mainframe.mainframe.path+"backgrounds/"+link,this,"bitmap");
			bl.onComplete(init);
			bl.loadFiles();
		}
		private function init(e)
		{
			//trace("ICON INIT "+bitmap);
			var scale=40/bitmap.width;
			bitmap.scaleX=scale;
			bitmap.scaleY=scale;
			icn.holder.addChild(bitmap);
		}
		private function setBack(e)
		{
			mainframe.setBackground("backgrounds/"+link);
		}
		public function get value()
			
		{
			return (mainframe.mainframe.path+"backgrounds/"+link);
		}

	}

}